package src.accenture.com.entity;

import java.io.Serializable;

import java.math.BigDecimal;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@NamedQueries( { @NamedQuery(name = "MblHolidaytype.findAll", query = "select o from MblHolidaytype o") })
@Table(name = "MBL_HOLIDAYTYPE")
@NamedNativeQueries( { 
    @NamedNativeQuery(name = "MblHolidaytype.getHolidayTypeNameById", 
                                         query = 
                                         "SELECT DESCRIBE \n" + 
                                         "FROM 	MBL_HOLIDAYTYPE \n" + 
                                         "WHERE	TYPE_ID = ?typeid " 
                                        )
, 
    @NamedNativeQuery(name =  "MblHolidaytype.getHolidaytype", 
                                         query = 
                                         "SELECT TYPE_ID, EMP_HOLIDAYNUM, MANAGER_HOLIDAYNUM, DESCRIBE \n" + 
                                         "	FROM  	MBL_HOLIDAYTYPE \n" + 
                                         "	WHERE 	TYPE_ID = ?typeId ", 
                                         resultClass = MblHolidaytype.class)
        } )
public class MblHolidaytype implements Serializable {
    @Column(length = 4000)
    private String describe;
    @Column(name = "EMP_HOLIDAYNUM", nullable = false)
    private double empHolidaynum;
    @Column(name = "MANAGER_HOLIDAYNUM", nullable = false)
    private double managerHolidaynum;
    @Id
    @Column(name = "TYPE_ID", nullable = false, length = 10)
    private String typeId;
    @OneToMany(mappedBy = "mblHolidaytype")
    private List<MblRegistration> mblRegistrationList2;

    public MblHolidaytype() {
    }

    public MblHolidaytype(String describe, double empHolidaynum, double managerHolidaynum, String typeId) {
        this.describe = describe;
        this.empHolidaynum = empHolidaynum;
        this.managerHolidaynum = managerHolidaynum;
        this.typeId = typeId;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public double getEmpHolidaynum() {
        return empHolidaynum;
    }

    public void setEmpHolidaynum(double empHolidaynum) {
        this.empHolidaynum = empHolidaynum;
    }

    public double getManagerHolidaynum() {
        return managerHolidaynum;
    }

    public void setManagerHolidaynum(double managerHolidaynum) {
        this.managerHolidaynum = managerHolidaynum;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public List<MblRegistration> getMblRegistrationList2() {
        return mblRegistrationList2;
    }

    public void setMblRegistrationList2(List<MblRegistration> mblRegistrationList2) {
        this.mblRegistrationList2 = mblRegistrationList2;
    }

    public MblRegistration addMblRegistration(MblRegistration mblRegistration) {
        getMblRegistrationList2().add(mblRegistration);
        mblRegistration.setMblHolidaytype(this);
        return mblRegistration;
    }

    public MblRegistration removeMblRegistration(MblRegistration mblRegistration) {
        getMblRegistrationList2().remove(mblRegistration);
        mblRegistration.setMblHolidaytype(null);
        return mblRegistration;
    }
}
